package com.example.weixin_01.controller;

import com.example.weixin_01.pojo.UserLogin;
import com.example.weixin_01.services.UserLoginServicesImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WeixinController {
    @Autowired
    UserLoginServicesImpl userLoginServicesImpl;
    @RequestMapping("/weiXinLogin")
    public String toLogin(String username,String password){
        System.out.println(username);
        System.out.println(password);
        UserLogin userLogin = new UserLogin(username, password);
        UserLogin userLogin1 = userLoginServicesImpl.queryByName(userLogin.getUsername());
        if(userLogin1 != null){
            return "ok";
        }
        return "no";
    }
}
